<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script type="module">
    import {reactive} from './03_reactive.js'
    import {ref} from './03_ref.js'

    /* 测试 */
    // reactive(target)
    const state = reactive({  // 创建proxy对象
      a1: 1,
      a2: {  // 再创建proxy对象
        a3: 2
      }
    })
    // console.log(state)

    // console.log(state.a1)
    // console.log(state.a2.a3)
    // state.a2.a3 = 3
    // state.a4 = 'abc'
    // delete state.a1

    
    /* 测试 */
    // const count = ref(1)
    // console.log(count)
    // console.log(count.value)
    // count.value = 2

    // person ref对象的value值是一个proxy对象
    const person = ref({
      name: 'tom',
      age: 12
    })
    // console.log(person)
    // console.log(person.value.name)
    // person.value = {name: 'Jack', age: 13}
    // person.value.name = 'Jack'
  </script>
</body>
</html>